<?php require_once 'source.php';?>
<?php require_once 'config.php';?>
<?php require_once 'dao/dao_news.php';?>
<?php require_once 'dao/dao_qa.php';?>
<?php require_once 'dao/dao_db.php';?>
<?php require_once 'dao/dao_sys_manage.php';?>
<?php 
	session_start();
	session_cache_limiter('private');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo SYSTITLE?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body class="w">
<div class="wrapper wrapper_index">
	<div class="banner">
	</div>
	<div id="index_content">
		<div id="index_left">
			<div class="index_column">
				<div class="index_column_title"><?php echo STUDENTNOTICE?></div>
				<div>
					<ul>
					<?php 
						$result=get_news_index(STUDENTNOTICECODE);
						if(mysql_num_rows($result)!=0){
							while(($row=mysql_fetch_array($result))!=FALSE){
					?>
						<li><span><?php echo $row['NEWSDATE']?></span><a href="news.php?nid=<?php echo $row['Id']?>" target="_blank"><?php echo $row['TITLE']?></a></li>
					<?php
							}
					 }else{
					 ?>
					<li><?php echo NOREPORT?></li>
					 <?php 	
					 }
					?>
					</ul>
				</div>
			</div>
			<div class="index_column">
				<div class="index_column_title"><?php echo JOBNEWS?></div>
				<div>
					<ul>
						<?php 
						$result=get_news_index(JOBNEWSCODE);
						if(mysql_num_rows($result)!=0){
							while(($row=mysql_fetch_array($result))!=FALSE){
					?>
						<li><span><?php echo $row['NEWSDATE']?></span><a href="news.php?nid=<?php echo $row['Id']?>" target="_blank"><?php echo $row['TITLE']?></a></li>
					<?php
							}
					 }else{
					 ?>
					<li><?php echo NOREPORT?></li>
					 <?php 	
					 }
					?>
					</ul>
				</div>
			</div>
			<div class="c"></div>
			<div class="index_column">
				<div class="index_column_title"><?php echo REPORTNEWS?></div>
				<div>
					<ul>
						<?php 
						$result=get_news_index(REPORTNEWSCODE);
						if(mysql_num_rows($result)!=0){
							while(($row=mysql_fetch_array($result))!=FALSE){
					?>
						<li><span><?php echo $row['NEWSDATE']?></span><a href="news.php?nid=<?php echo $row['Id']?>" target="_blank"><?php echo $row['TITLE']?></a></li>
					<?php
							}
					 }else{
					 ?>
					<li><?php echo NOREPORT?></li>
					 <?php 	
					 }
					?>
					</ul>
				</div>
			</div>
			<div class="index_column">
				<div class="index_column_title"><?php echo PUBLICBBS?></div>
				<div>
					<ul>
					<?php 
						$result=is_bbs_on();
						$row=mysql_fetch_array($result);
						if($row['BBSSWITCH']==ON){
					?>
						<?php 
						$result=get_questions_index();
						if(mysql_num_rows($result)!=0){
							while(($row=mysql_fetch_array($result))!=FALSE){
					?>
						<li><span><?php echo substr($row['DATETIME'],0,10)?></span><a href="discussion.php?qid=<?php echo $row['Id']?>" target="_blank"><?php echo $row['TITLE']?></a></li>
					<?php
							}
					 }else{
					 ?>
					 <li><?php echo NOREPORT?></li>
					 <?php 	
					 }
						}else{
					?>
					<li><?php echo NOREPORT?></li>		
					<?php } ?>
					</ul>
				</div>
			</div>
			<div class="c"></div>
		</div>
		<div id="index_right">
		<form action="service/service_login.php" method="post">
			<div id="logon_frame">
				<h2><?php echo SIGNIN?></h2>
				<?php 
					if(isset($_SESSION['userid'])&&isset($_SESSION['level'])){
				?>
				<table cellpadding="5" cellspacing="8" border="0" width="100%">
					<tr><th style="text-align:left;width:40px;"><?php echo $_SESSION['level']==STUDENT?STUDENDTID:TEACHERID;?>:</th><td><?php echo $_SESSION['userid']?></td></tr>
					<tr><th style="text-align:left;"><?php echo USERNAME?>:</th><td><?php echo $_SESSION['username']?></td></tr>
					<tr><td colspan="2"><a href="home.php"><?php echo SITEMANAGE?></a> <a href="service/service_signout.php"><?php echo QUIT?></a></td></tr>
				</table>
				<?php 		
					}else{
				?>				
				<table cellpadding="0" cellspacing="5">
					<tr><td style="text-align:right;"><?php echo USERID?> : </td><td><input type="text" name="username" style="width:120px;padding:1px;"/></td></tr>
					<tr><td style="text-align:right;"><?php echo PASSWORD?> : </td><td><input type="password" name="password" style="width:120px;padding:1px;"/></td></tr>
					<tr><td></td><td><input type="submit" value="<?php echo SIGNIN?>" style="background:url(img/title_bg.gif) repeat-x center;border:1px solid #666699; width:67px;height:19px;"/></td></tr>
				</table>
				<?php 		
					}
				?>
			</div>
		</form>
		<div id="site_link">
			<ul>
				<li><a href="http://oa.dlmu.edu.cn" target="_blank"><?php echo LINKOA?></a></li>
				<li><a href="http://grs.dlmu.edu.cn/" target="_blank"><?php echo LINKGRA?></a></li>
				<li><a href="http://www.dlmu.edu.cn/" target="_blank"><?php echo LINKHOME?></a></li>
				<li><a href="http://lib.dlmu.edu.cn/" target="_blank"><?php echo LINKLIB?></a></li>
				<li><a href="http://fleet.dlmu.edu.cn/" target="_blank"><?php echo LINKNAVI?></a></li>
			</ul>
		</div>
		</div>
	</div>
	<div class="c"></div>
	<hr style="margin-top:15px;"/>
	<div id="copyright">
	<span><?php echo COPYRIGHT?></span>
	<a href="mailto:<?php echo AUTHER?>"><?php echo CONTACTAUTHER?></a>
</div>
</div>
</body>
</html>
